﻿using System;
using Gadgeteer.Interfaces.Graphics;
using Gadgeteer.Modules;

namespace Gadgeteer.Interfaces.GT
{
    internal class SimpleGraphicsWrapper : ISimpleGraphics
    {
        private readonly Module.DisplayModule.SimpleGraphicsInterface simpleGraphics;

        public SimpleGraphicsWrapper(Module.DisplayModule.SimpleGraphicsInterface simpleGraphics)
        {
            this.simpleGraphics = simpleGraphics;
        }

        public void DisplayImage(Picture picture, uint x, uint y)
        {
            simpleGraphics.DisplayImage(picture, x, y);
        }

        public void Clear()
        {
            simpleGraphics.Clear();
        }

        public bool AutoRedraw
        {
            get { return simpleGraphics.AutoRedraw; }
            set { simpleGraphics.AutoRedraw = value; }
        }

        public Color BackgroundColor
        {
            get { return simpleGraphics.BackgroundColor; }
            set { simpleGraphics.BackgroundColor = value; }
        }

        public uint Height
        {
            get { return simpleGraphics.Height; }
        }

        public uint Width
        {
            get { return simpleGraphics.Width; }
        }

        public void DisplayText(string text, Microsoft.SPOT.Font font, Color color, uint x, uint y)
        {
            simpleGraphics.DisplayText(text, font, color, x, y);
        }

        public void ClearNoRedraw()
        {
            simpleGraphics.ClearNoRedraw();
        }

        public Color GetPixel(int x, int y)
        {
            return simpleGraphics.GetPixel(x, y);
        }

        public void SetPixel(Color color, uint x, uint y)
        {
            simpleGraphics.SetPixel(color, x, y);
        }
    }
}
